package cn.jiangjiesheng.bootstrap.cloud.service.metadata;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.DependsOn;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by dev@jiangjiesheng.cn on 2022/11/2  <br/>
 *
 * @author dev@jiangjiesheng.cn
 */
@Slf4j
@RequestMapping("/")
@RestController
@DependsOn("metadataSingleton")
public class MetadataEndpoint {

    @Autowired
    @Qualifier("metadataSingleton")
    private MetadataSingleton metadataSingleton;

    @GetMapping("/metadata.json")
    public MetadataSingleton metadataJson() {
        return metadataSingleton;
    }


    @GetMapping("/metadata")
    public MetadataSingleton metadata() {
        return metadataSingleton;
    }

}
